//
//  MCMarketingDetailHeaderView.swift
//  StoreManage
//
//  Created by MC on 2018/6/27.
//  Copyright © 2018年 MC. All rights reserved.
//

import UIKit

class MCMarketingDetailHeaderView: UIView {

    override init(frame: CGRect) {
        super.init(frame: frame)
      
        self.backgroundColor = UIColor.white
        self.frame = CGRect.init(x: 0, y: 0, width: MCScreenWidth, height: 127)
     
        self.addSubview(timeLabel)
        timeLabel.snp.remakeConstraints { (make) ->Void in
            make.right.equalTo(-15)
            make.top.equalTo(15)
            make.height.equalTo(17)
        }

        
        self.addSubview(titleLabel)
        titleLabel.snp.remakeConstraints { (make) ->Void in
            make.left.equalTo(15)
            make.top.equalTo(10)
            make.height.equalTo(24)
            make.right.lessThanOrEqualTo(timeLabel.snp.left).offset(-5)
        }
        
        self.addSubview(detailLabel)
        detailLabel.snp.remakeConstraints { (make) ->Void in
            make.left.equalTo(15)
            make.right.equalTo(-15)
            make.top.equalTo(titleLabel.snp.bottom).offset(4)
            make.height.equalTo(20)
        }
        
        self.addSubview(lineOneView)
        lineOneView.snp.remakeConstraints { (make) ->Void in
            make.left.right.equalTo(self)
            make.height.equalTo(1)
            make.top.equalTo(detailLabel.snp.bottom).offset(10)
        }
        
        self.addSubview(activityTimeLabel)
        activityTimeLabel.snp.remakeConstraints { (make) ->Void in
            make.left.equalTo(15)
            make.top.equalTo(lineOneView.snp.bottom).offset(10)
            make.height.equalTo(18)
        }
        
        self.addSubview(pickUpTimeLabel)
        pickUpTimeLabel.snp.remakeConstraints { (make) ->Void in
            make.left.equalTo(15)
            make.top.equalTo(activityTimeLabel.snp.bottom).offset(2)
            make.height.equalTo(18)
        }
    }
    
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    lazy var titleLabel: UILabel = {
        let label = UILabel()
        label.font = MCFont(17)
        label.text = "618社区促销活动"
        return label
    }()
    
    lazy var timeLabel: UILabel = {
        let label = UILabel()
        label.font = MCFont(12)
        label.textColor = UIColor.MCGray_middle
        label.text = "2018-01-01"
        return label
    }()

    
    lazy var detailLabel: UILabel = {
        let label = UILabel()
        label.font = MCFont(14)
        label.textColor = UIColor.MCGray_middle
        label.text = "一年一度618社区年中大促赶紧囤货吧"
        return label
    }()
    
    lazy var activityTimeLabel: UILabel = {
        let label = UILabel()
        label.font = MCFont(13)
        label.textColor = UIColor.MCGray_middle
        label.text = "活动时间：2018-06-16~2018-06-20"
        return label
    }()
    
    lazy var pickUpTimeLabel: UILabel = {
        let label = UILabel()
        label.font = MCFont(13)
        label.textColor = UIColor.MCGray_middle
        label.text = "提货时间：2018-06-16~2018-06-20"
        return label
    }()

    
    lazy var lineOneView: UIView = {
        let view = UIView()
        view.backgroundColor = UIColor.MCGray_light
        return view
    }()
}
